<? 
require_once '../includes/funciones.php';
//include ("seguridad.php");
conexion();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title><?php titulopanel();?></title>
<link rel="STYLESHEET" type="text/css" href="estilo.css">

<script type="text/javascript" src="../plugins/jquery.js"></script>
<script type="text/javascript" src="../plugins/jquery_validate/jquery.validate.js"></script>
<script type="text/javascript" src="../plugins/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>

<link type="text/css" href="../plugins/jquery_ui/css/redmond/jquery-ui-1.8.13.custom.css" rel="Stylesheet" />   
<script type="text/javascript" src="../plugins/jquery_ui/js/jquery-ui-1.8.13.custom.min.js"></script> 
<script type="text/javascript">
tinyMCE.init({
    mode : 'exact',
    theme : 'advanced',
	elements: 'date, reading, reflection',
    theme_advanced_buttons1 : 'bold,italic,underline,undo,redo',
    theme_advanced_buttons2 : '',
    theme_advanced_buttons3 : '',
    theme_advanced_toolbar_location : 'top',
    theme_advanced_toolbar_align : 'left',    
    init_instance_callback : "initialiseInstance"
});


$(document).ready(function() {
$("input[type='submit']").click(function() {
tinyMCE.triggerSave();
})
})
	
	
</script>

<!-- /TinyMCE --> 
<!-- EDITOR -->
<!-- Errores jaquery -->


<script>
  $(document).ready(function(){
	        $("#fecha").datepicker();
	
	$("#form").validate({
		rules: {			
			date: {
				required: true
					},
			title: {
				required: true
				},
			body: {
				required: true
				}	
		},		
		                
		messages: {

            date:{
                required: "Seleccione una fecha"
                 },    
            title:{
                required:"Coloque un titulo"        
                  },        
            body: "Coloque un cuerpo"		
                  }
	});
	
  });

</script>
<!-- /ERRORES -->


</head>

<body>


<div id="contenedor">

  	<div id="encabezado"><?php include('header.php') ?></div><!--fin de encabezado-->



	<div id="menuizquierda"><?php include('menu.php') ?></div>	<!--fin de menuizquierda-->

	
	<div id="content">			
		<div id="formulario">
			<br>
			<span class="title">Cargar Noticia</span>
			<br>
			<form class ="admin" id="form" name="form" action="control_noticias.php" method="post" enctype="multipart/form-data">
			<br>
			<fieldset class="admin">			
			<legend>Noticia</legend>
			<p><span>Publicar:</span>
			<input type="checkbox" name="published" value="1" checked />
			</p>
			<br>
			<p><span>Fecha:</span>
			<input type="text" name="date" id="fecha">

			</p>
			<br>
			<!--  <p><span>
			Categoria:
			</span>
			
			<select name="categorie" id="categorie">
			<option value ="">Elija categoria</option> 
			<?php 
			//$concla= mysql_query("SELECT * FROM categories where id_grupos = 1 and id !=5");
			//while($rowconcla=mysql_fetch_array($concla)){
						//echo '<option value="'.$rowconcla['id'].'">'.$rowconcla['description'].' </option>';
			//}
					
			?>
				</select> 
				</p>	-->			
				<br>
				<p><span>T&iacute;tulo:</span>				
				<input type="text" name="title" id="title" onkeyup="if (this.value.length == 139) this.disabled = true;" size="70px">
				</p>
				<br>
				<!--  <p><span>
				Copete:
				</span>
				<textarea name="summary" id="summary" cols="60" rows="3"></textarea>
				</p>	-->
				<br><br><br/>
				
				<p><span>
				Cuerpo:
				</span>				
				<textarea name="body" id="body" cols="60" rows="10" ></textarea>
				</p>
				
				</fieldset> 
				<br>
				
							
			<fieldset class="admin">
			<legend>Imagen</legend>
				<p><span>Cargar una Imagen:</span>				
				<input type="file" name="imagen">
				</p>
				<br>
				
				<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
				<p><span>
				Comentario:</span>				
				<input type="text" name="comment" size="60" >
				</p>
			</fieldset>
				<br>
				<br>
				<input name="boton" type="hidden" id="boton" value="1"></input>
				<input name="buttonadmin" id="buttonadmin" type="submit" class="buttonadmin" value="Aceptar">
				<a class="enlacecancelar" href="noticias.php"><input type="button" class="buttoncancelar" value="Cancelar"></a>
				<br>
				
				<br>
				</form>
				<br>
				
	</div><!-- cierre formulario -->
	<br>
	<br>
	</div><!--fin de content-->


	<div id="piepagina">
	</div>
			<!--fin de piepagina-->
</div>

</body>

</html>


